<script setup lang="ts">
import { ContentWrap } from '@/components/ContentWrap'
import { Search } from '@/components/Search'
// import { Dialog } from '@/components/Dialog'
import { useI18n } from '@/hooks/web/useI18n'
import {
  ElButton,
  ElMessageBox,
  ElMessage,
  ElTable,
  ElTableColumn,
  ElInput,
  ElDialog,
  ElDropdownMenu,
  ElDropdownItem,
  ElSelect,
  ElOption,
  ElPopover,
  ElDatePicker,
  ElRow,
  ElCol,
  ElForm,
  ElFormItem
} from 'element-plus'
import { Table } from '@/components/Table'
import {
  sendIndex,
  sendDel,
  sendEdit,
  deliverSetStatus,
  deliverCombine,
  storeSelect,
  customsSelect,
  deliverEditMulti,
  transportSelect,
  placestartSelect,
  dfhdExportExcel
} from '@/api/common'
import { useTable } from '@/hooks/web/useTable'
import { TableData } from '@/api/table/types'
import { ref, unref, reactive } from 'vue'
import Write from './components/Write.vue'
// import Detail from './components/Detail.vue'
import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
import { useRouter } from 'vue-router'
import { useEmitt } from '@/hooks/web/useEmitt'
import { Dialog } from '@/components/Dialog'
import Detail from './components/Detail.vue'
import { useAppStoreWithOut } from '@/store/modules/app'
import { useCache } from '@/hooks/web/useCache'
const appStore = useAppStoreWithOut()
const { wsCache } = useCache()
// import { TableColumn } from '@/types/table'
//用户权限数组
const userRlues = wsCache.get(appStore.getUserInfo).rlues
const userId = wsCache.get(appStore.getUserInfo).id

const checkRlues = (rlues) => {
  //检查权限
  if (userRlues.includes(rlues)) {
    return true
  } else {
    ElMessage.error('当前用户无权限操作，请联系管理员')
    return false
  }
}
const { push } = useRouter()
const { register, tableObject, methods } = useTable<TableData>({
  getListApi: sendIndex,
  delListApi: sendDel,
  response: {
    list: 'data',
    total: 'total'
  },
  defaultParams: {
    filter: '{"status":"6"}',
    op: '{"status":"="}'
  },
  find: userRlues.includes('201') ? -1 : userId
})

const { getList, setSearchParams } = methods

getList()

const { emitter } = useEmitt()

useEmitt({
  name: 'getList',
  callback: (type: string) => {
    if (type === 'add') {
      tableObject.currentPage = 1
    }
    getList()
  }
})

const { t } = useI18n()

const ydString = ref('')
const tkShow = ref(false)
const store_id = ref()
const confirmTk = async () => {
  if (ydString.value) {
    ydString.value = ydString.value.replace(/，/g, ',')
  }

  const res = await deliverCombine({
    deliver_ids: ydString.value,
    store_id: store_id.value,
    comment: ''
  })
}

const crudSchemas = reactive<CrudSchema[]>([
  {
    field: 'index',
    label: t('tableDemo.index'),
    type: 'index',
    form: {
      show: false
    },
    detail: {
      show: false
    }
  },
  {
    field: 'delivery_date',
    width: '80px',
    label: t('invoice.receivingDate'),
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'send_time',
    width: '80px',
    label: t('invoice.deliveryTime'),
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'placestart_text',
    width: '80px',
    label: t('router.origin'),
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'placeend_id',
    width: '80px',
    label: t('router.destination'),
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'client_code',
    width: '80px',
    label: t('customerManagement.customerNo'),
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'shouhuo',
    width: '80px',
    label: t('customerManagement.consignee'),
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'remark',
    width: '80px',
    label: t('userDemo.remark'),
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'transport_text',
    width: '80px',
    label: t('router.transport'),
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'waybill',
    label: t('invoice.waybillNumber'),
    width: 150,
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'units',
    width: '80px',
    label: '件数',
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'weight',
    width: '80px',
    label: '重量',
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'density',
    width: '80px',
    label: '密度',
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'volume',
    width: '80px',
    label: '体积',
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'delivery_price',
    width: '80px',
    label: '收货单价',
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'total_fee',
    width: '110px',
    label: t('invoice.totalReceivableExpenses'),
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'remark',
    width: '80px',
    label: t('invoice.productNameRemarks'),
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'quantity',
    width: '80px',
    label: t('invoice.packingQuantity'),
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'usd_value',
    width: '80px',
    label: t('invoice.usDollarCreditValue'),
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'insurance_rate',
    width: '80px',
    label: t('invoice.guaranteeRate'),
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'insurance_fee',
    width: '80px',
    label: t('invoice.insurancePremiumsReceivabl'),
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'pack_fee',
    width: '80px',
    label: t('invoice.packingCharges'),
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'short_fee_cny',
    width: '80px',
    label: t('invoice.shortdistancefee'),
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'other_fund',
    width: '80px',
    label: t('invoice.otherReceivables'),
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'paytype_text',
    width: '80px',
    label: t('invoice.paymentMethod'),
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'imitate_text',
    width: '80px',
    label: t('invoice.whetherToImitateTheBrand'),
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  {
    field: 'delivery_market',
    width: '80px',
    label: '到货市场',
    form: {
      show: false
    },
    detail: {
      show: true
    }
  },
  // {
  //   field: 'status',
  //   label: t('invoice.documentStatus'),
  //   table: {
  //     show: false
  //   },
  //   search: {
  //     show: true,
  //     component: 'Select',
  //     componentProps: {
  //       options: [
  //         {
  //           label: '仓库保存',
  //           value: 0
  //         },
  //         {
  //           label: '仓库提交',
  //           value: '1'
  //         },
  //         {
  //           label: '制单保存',
  //           value: '2'
  //         },
  //         {
  //           label: '制单提交',
  //           value: '3'
  //         },
  //         {
  //           label: '已审核',
  //           value: '4'
  //         },
  //         {
  //           label: '已到货',
  //           value: '5'
  //         }
  //       ]
  //     }
  //   },
  //   form: {
  //     show: false
  //   },
  //   detail: {
  //     span: 24,
  //     show: false
  //   }
  // },
  // {
  //   field: 'send_time',
  //   label: t('common.TimeText'),
  //   table: {
  //     show: false
  //   },
  //   search: {
  //     show: true,
  //     component: 'DatePicker',
  //     componentProps: {
  //       type: 'date',
  //       valueFormat: 'YYYY-MM-DD'
  //     }
  //   },
  //   form: {
  //     show: false,
  //     colProps: {
  //       span: 24
  //     }
  //   },
  //   detail: {
  //     span: 6,
  //     show: true
  //   }
  // },
  // {
  //   field: 'status_text',
  //   label: t('invoice.documentStatus'),
  //   search: {
  //     show: false
  //   },
  //   form: {
  //     show: false
  //   },
  //   detail: {
  //     span: 24,
  //     show: false
  //   }
  // },
  // {
  //   field: 'fahuo',
  //   width: '80px',
  //   label: t('customerManagement.shipper'),
  //   form: {
  //     show: false
  //   },
  //   detail: {
  //     show: true
  //   }
  // },
  // {
  //   field: 'shouhuo_mobile',
  //   width: '150',
  //   label: t('customerManagement.consigneePhone'),
  //   form: {
  //     show: false
  //   },
  //   detail: {
  //     show: true
  //   }
  // },
  // {
  //   field: 'store_text',
  //   width: '80px',
  //   label: t('invoice.locationOfGoods'),
  //   form: {
  //     show: false
  //   },
  //   detail: {
  //     show: true
  //   }
  // },

  // {
  //   field: 'weight',
  //   width: '80px',
  //   label: t('invoice.totalWeight'),
  //   form: {
  //     show: false
  //   },
  //   detail: {
  //     show: true
  //   }
  // },
  // {
  //   field: 'volume',
  //   width: '80px',
  //   label: t('invoice.totalVolume'),
  //   form: {
  //     show: false
  //   },
  //   detail: {
  //     show: true
  //   }
  // },
  // {
  //   field: 'base_freight',
  //   width: '80px',
  //   label: t('invoice.businessFloorFreight'),
  //   form: {
  //     show: false
  //   },
  //   detail: {
  //     show: true
  //   }
  // },
  // {
  //   field: 'agency_fund',
  //   width: '80px',
  //   label: t('invoice.invoicing'),
  //   form: {
  //     show: false
  //   },
  //   detail: {
  //     show: true
  //   }
  // },
  // {
  //   field: 'transport_price',
  //   width: '80px',
  //   label: t('invoice.fieghtPrice'),
  //   form: {
  //     show: false
  //   },
  //   detail: {
  //     show: true
  //   }
  // },
  // {
  //   field: 'explain',
  //   width: '80px',
  //   label: t('invoice.illustrate'),
  //   form: {
  //     show: false
  //   },
  //   detail: {
  //     show: true
  //   }
  // },

  {
    field: 'action',
    width: '80px',
    label: t('formDemo.operate'),
    form: {
      show: false
    },
    fixed: 'right',
    detail: {
      show: false
    }
  }
])

const { allSchemas } = useCrudSchemas(crudSchemas)

const AddAction = (rlues) => {
  if (checkRlues(rlues)) push('/logistics/waitInvoiceAdd')
}
const cos = async () => {
  console.log('????')
  tkShow.value = true

  // ElMessageBox.confirm(`是否合包?`, t('common.delWarning'), {
  //   confirmButtonText: t('common.delOk'),
  //   cancelButtonText: t('common.delCancel'),
  //   type: 'warning'
  // }).then(async () => {
  //   const res = await deliverCombine({
  //     deliver_ids: deliver_ids,
  //     store_id: store_id,
  //     comment: ''
  //   })
  //   if (res) {
  //     ElMessage.success('合包成功')
  //     emitter.emit('getList', 'edit')
  //   }
  // })
}

const delLoading = ref(false)

const delData = async (row: TableData | null, multiple: boolean, ruls: string) => {
  if (!checkRlues(ruls)) return false
  tableObject.currentRow = row
  const { delList, getSelections } = methods
  const selections = await getSelections()
  delLoading.value = true
  await delList(
    multiple ? selections.map((v) => v.id) : [tableObject.currentRow?.id as string],
    multiple
  ).finally(() => {
    delLoading.value = false
  })
}

// const actionType = ref('')
const dialogTitle = ref('')
const dialogVisible = ref(false)
const action = (row: TableData, type: string, ruls: string) => {
  if (!checkRlues(ruls)) return false
  switch (type) {
    case 'Edit':
      {
        push(`/logistics/waitInvoice${type}?id=${row.id}&isEdit=true`)
      }
      break
    case 'Passed':
      {
        ElMessageBox.confirm(`是否${t('purchaseOrder.passedReview')}?`, t('common.delWarning'), {
          confirmButtonText: t('common.delOk'),
          cancelButtonText: t('common.delCancel'),
          type: 'warning'
        }).then(async () => {
          const res = await deliverSetStatus({
            ids: row.id,
            status: 4
          })
          if (res) {
            ElMessage.success('提交成功')
            emitter.emit('getList', 'edit')
          }
        })
      }
      break
    case 'ckSubmit':
      {
        // ElMessageBox.confirm(`是否提交仓库?`, t('common.delWarning'), {
        ElMessageBox.confirm(`是否回退出库单?`, t('common.delWarning'), {
          confirmButtonText: t('common.delOk'),
          cancelButtonText: t('common.delCancel'),
          type: 'warning'
        }).then(async () => {
          const res = await deliverSetStatus({
            ids: row.id,
            status: 0
          })
          if (res) {
            ElMessage.success('提交成功')
            emitter.emit('getList', 'edit')
          }
        })
      }
      break
    case 'zdSubmit':
      {
        ElMessageBox.confirm(`是否提交制单?`, t('common.delWarning'), {
          confirmButtonText: t('common.delOk'),
          cancelButtonText: t('common.delCancel'),
          type: 'warning'
        }).then(async () => {
          const res = await deliverSetStatus({
            ids: row.id,
            status: 4
          })
          if (res) {
            ElMessage.success('提交成功')
            emitter.emit('getList', 'edit')
          }
        })
      }
      break
    case 'detail':
      {
        // dialogTitle.value = '详情'
        // dialogVisible.value = true
        // tableObject.currentRow = row
        push(`/logistics/waitInvoiceEdit?id=${row.id}&isDetail=true`)
      }
      break
    default:
      break
  }
}
//货物位置
const locationOfGoodsArr: any = reactive([])
const getStoreSelect = async () => {
  let res: any = await storeSelect({})
  res.data.list.forEach((item) => {
    item.type == 1 &&
      locationOfGoodsArr.push({
        label: item.name,
        value: item.id
      })
  })
}
getStoreSelect()
const writeRef = ref<ComponentRef<typeof Write>>()

const loading = ref(false)

const save = async () => {
  const write = unref(writeRef)
  await write?.elFormRef?.validate(async (isValid) => {
    if (isValid) {
      loading.value = true
      const data = (await write?.getFormData()) as TableData
      const res = await sendEdit(data, data.id)
        .catch(() => {})
        .finally(() => {
          loading.value = false
        })
      if (res) {
        dialogVisible.value = false
        tableObject.currentPage = 1
        getList()
      }
    }
  })
}
const tjTotal = ref(0)
const zlTotal = ref(0)
const peihuoShow = ref(false)
const peihuoData: any = reactive([])
const phList = ref<InstanceType<typeof ElTable>>()
const peihuo = () => {
  let list = phList.value!.elTableRef.getSelectionRows()
  selectDateBtn(list)
  peihuoShow.value = true
  console.log(list)
}
const selectDate = ref()
const selectDateBtn = async (list) => {
  // console.log(selectDate.value)
  peihuoData.length = 0
  list.forEach((item) => {
    item.customs_name = Number(item.customs_name)
    item.export_volume = item.export_volume ? item.export_volume : item.volume
    item.export_weight = item.export_weight ? item.export_weight : item.weight
    item.export_density = item.export_density ? item.export_density : item.density
    tjTotal.value = (Number(tjTotal.value) + item.volume).toFixed(2)
    zlTotal.value = (Number(zlTotal.value) + item.weight).toFixed(2)
    peihuoData.push(item)
  })
  // peihuoData = res.data
}
const saveData = async () => {
  let data = []
  console.log(peihuoData)
  peihuoData.forEach((item) => {
    let a = {
      id: item.id,
      customs_name: item.customs_name,
      export_transport: item.export_transport,
      export_volume: item.export_volume,
      export_weight: item.export_weight,
      export_density: item.export_density
    }
    data.push(a)
  })
  // data = peihuoData
  let res = await deliverEditMulti(data)
  if (res.code == 1) {
    peihuoShow.value = false
  }
}
const sum = () => {
  peihuoData.forEach((item) => {
    item.export_density = (item.export_weight / item.export_volume).toFixed(2)
  })
}
const formatDate = (time) => {
  // 中国标准时间
  let date1 = time
  // 年
  let y = date1.getFullYear()
  // 月
  let m = date1.getMonth() + 1
  m = m < 10 ? '0' + m : m
  // 日
  let d = date1.getDate()
  d = d < 10 ? '0' + d : d
  // 时
  let h = date1.getHours()
  h = h < 10 ? '0' + h : h
  // 分
  let M = date1.getMinutes()
  M = M < 10 ? '0' + M : M
  // 秒
  let s = date1.getSeconds()
  s = s < 10 ? '0' + s : s
  return y + '-' + m + '-' + d + ' ' + h + ':' + M + ':' + s
}
// 清关公司下拉选择
const customArr: any = reactive([])
const customArr2: any = reactive([])
const getCustomArr = async () => {
  let res = await customsSelect()
  console.log('---清关公司数据---', res)
  res.data.list.forEach((item) => {
    customArr.push({
      label: item.name,
      value: item.id,
      transport: item.transport
    })

    customArr2.push({
      label: item.name,
      value: item.name,
      transport: item.transport
    })
  })
}

getCustomArr()

// 清关公司
const customs_id: any = ref(null)
//获取转出运输方式
const transportArr: any = reactive([])
const getExportTranspor = (e) => {
  // console.log(e)
  transportArr.length = 0
  let data = customArr.find((item) => {
    return item.value == e
  })
  let arr = data.transport ? JSON.parse(data.transport) : []
  if (arr.length > 0) {
    arr.forEach((element) => {
      transportArr.push(element)
    })
  }
  console.log('----transportArr-----', transportArr)
}

// 运输方式
const modeOfTransport: any = ref('')
const modeOfTransportArr: any = reactive([])
const getTransportSelect = async () => {
  let res: any = await transportSelect({})
  res.data.list.forEach((item) => {
    modeOfTransportArr.push({
      label: item.name,
      value: item.name
    })
  })
}
getTransportSelect()

//始发地
const origin: any = ref('')
const originArr: any = reactive([])
const getOriginSelect = async () => {
  let res: any = await placestartSelect({})
  res.data.list.forEach((item) => {
    originArr.push({
      label: item.name,
      value: item.name
    })
  })
}
getOriginSelect()

// 导出待出库单
const dfhdExport = async (rlues) => {
  if (checkRlues(rlues)) {
    let res = await dfhdExportExcel(null)
    console.log('---导出待出库单---', res)
    const date = new Date()
    var Y = date.getFullYear()
    var M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
    var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
    const href = URL.createObjectURL(res.data)
    const box = document.createElement('a')
    box.download = `${Y}-${M}-${D}待出库单.xls`
    box.href = href
    box.click()
  }
}
</script>

<template>
  <ContentWrap>
    <Search
      :model="{}"
      :schema="allSchemas.searchSchema"
      @search="setSearchParams"
      @reset="setSearchParams"
    />

    <div class="mb-10px">
      <!-- <ElButton type="primary" @click="AddAction('24-1')">{{ t('exampleDemo.add') }}</ElButton>
      <ElButton :loading="delLoading" type="danger" @click="delData(null, true)">
        {{ t('exampleDemo.del') }}
      </ElButton> -->
      <ElButton type="primary" @click="dfhdExport('24-1')">导出待出库单</ElButton>
      <ElButton type="warning" @click="peihuo">批量配货</ElButton>
    </div>

    <Table
      v-model:pageSize="tableObject.limit"
      v-model:currentPage="tableObject.currentPage"
      :columns="allSchemas.tableColumns"
      :data="tableObject.tableList"
      :loading="tableObject.loading"
      :pagination="{
        total: tableObject.total
      }"
      @register="register"
      ref="phList"
    >
      <template #action="{ row }">
        <ElPopover placement="right" :width="80" trigger="click">
          <template #reference>
            <ElButton type="primary"> ··· </ElButton>
          </template>
          <div class="btnContent">
            <ElButton type="primary" @click="action(row, 'ckSubmit', '22-6')">
              回退出库单
            </ElButton>
            <!-- <ElButton
              type="primary"
              v-if="row.status == 0"
              @click="action(row, 'ckSubmit', '22-6')"
            >
              仓库提交
            </ElButton>
            <ElButton
              type="primary"
              v-if="row.status == 2 || row.status == 1"
              @click="action(row, 'zdSubmit', '22-6')"
            >
              提交
            </ElButton>
            <ElButton type="warning" v-if="row.status == 3" @click="action(row, 'Passed', '24-5')">
              {{ t('purchaseOrder.passedReview') }}
            </ElButton>
            <ElButton type="primary" @click="action(row, 'Edit', '24-2')">
              {{ t('exampleDemo.edit') }}
            </ElButton>
            <ElButton type="success" @click="action(row, 'detail', '24-4')">
              {{ t('router.watch') }}
            </ElButton>
            <ElButton type="danger" @click="delData(row, false, '24-3')">
              {{ t('exampleDemo.del') }}
            </ElButton> -->
          </div>
        </ElPopover>
      </template>
    </Table>
  </ContentWrap>

  <Dialog v-model="dialogVisible" :title="dialogTitle">
    <Detail :detail-schema="allSchemas.detailSchema" :current-row="tableObject.currentRow" />
  </Dialog>
  <ElDialog title="批量配货" v-model="peihuoShow" width="70%">
    <ElRow>
      <ElCol :offset="23" :span="4">
        <ElButton type="success" @click="saveData">保存</ElButton>
      </ElCol>
      <!-- <ElFormItem label-width="100px" label="清关公司名称" /> -->
      <!-- <ElFormItem label-width="100px" label="转出运输方式" /> -->
      <ElCol>
        <el-table :data="peihuoData" style="width: 100%">
          <el-table-column prop="shouhuo" label="收货人" />
          <el-table-column prop="waybill" label="运单号" width="180" />
          <el-table-column prop="" label="选择清关公司">
            <template #default="scope">
              <ElSelect
                clearable
                class="qianlan"
                :loading="loading"
                filterable
                v-model="scope.row.customs_name"
                @change="getExportTranspor($event)"
              >
                <el-option
                  v-for="item in customArr"
                  :key="item.id"
                  :label="item.label"
                  :value="item.value"
                />
              </ElSelect>
            </template>
          </el-table-column>
          <el-table-column prop="" label="选择运输方式">
            <template #default="scope">
              <ElSelect
                clearable
                v-model="scope.row.export_transport"
                class="qianlan"
                :loading="loading"
                filterable
              >
                <el-option
                  v-for="item in transportArr"
                  :key="item.id"
                  :label="item.name"
                  :value="item.name"
                />
              </ElSelect>
            </template>
          </el-table-column>
          <el-table-column prop="units" label="件数" />
          <el-table-column prop="volume" label="体积(m3)" />
          <el-table-column prop="weight" label="重量(KG)" />
          <el-table-column prop="density" label="密度" />
          <el-table-column prop="export_volume" label="转出体积(m3)">
            <template #default="scope">
              <ElInput v-model="scope.row.export_volume" @blur="sum()"
            /></template>
          </el-table-column>
          <el-table-column prop="export_weight" label="转出重量(KG)">
            <template #default="scope">
              <ElInput v-model="scope.row.export_weight" @blur="sum()"
            /></template>
          </el-table-column>
          <el-table-column prop="export_density" label="转出密度">
            <template #default="scope">
              <ElInput v-model="scope.row.export_density" disabled
            /></template>
          </el-table-column>
          <el-table-column prop="submarket_text" label="分货市场" />
          <el-table-column prop="imitate_text" label="是否仿牌" />
        </el-table>
      </ElCol>
      <ElRow>
        <ElCol> 体积总计：{{ tjTotal }} 重量总计：{{ zlTotal }} </ElCol>
      </ElRow>
    </ElRow>
  </ElDialog>
  <ElDialog title="填写合包单号" v-model="tkShow">
    <div class="tkTable">
      <ElSelect v-model="store_id" default style="margin: 20px 0px" placeholder="请选择仓库">
        <ElOption
          v-for="item in locationOfGoodsArr"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        />
      </ElSelect>
      <ElInput v-model="ydString" placeholder="请输入运单号,例如:xxx,xxx" />
    </div>
    <template #footer>
      <span class="dialog-footer">
        <ElButton @click="tkShow = false">取消</ElButton>
        <ElButton type="primary" @click="confirmTk"> 确认 </ElButton>
      </span>
    </template>
  </ElDialog>
</template>
<style lang="less" scoped>
.btnContent {
  display: flex;
  flex-direction: column;
  :deep .el-button + .el-button {
    margin-left: 0;
    margin-top: 15px;
  }
}
</style>
